package com.barneyx.mshinfoplatform.util;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.barneyx.mshinfoplatform.entity.common.DefaultSettingConfig;
import com.barneyx.mshinfoplatform.service.common.IDefaultSettingConfigService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class DefaultConfigUtil {
    @Resource
    private IDefaultSettingConfigService defaultSettingConfigService;


    /**
     * 获取指定类型的默认配制列表
     *
     * @param typeName
     * @return
     */
    public List<DefaultSettingConfig> getDefaultConfigByType(String typeName) {
        return defaultSettingConfigService.list(new LambdaQueryWrapper<DefaultSettingConfig>()
                .eq(DefaultSettingConfig::getConfigType, typeName.trim()));
    }
}
